#define _CRT_SECURE_NO_WARNINGS 1
#include <string.h>
int compare(char* version1, char* version2)
{
    int len1 = strlen(version1);
    int len2 = strlen(version2);
    int i = 0, j = 0;
    for (i = 0, j = 0; i < len1 || j < len2;)
    {
        int n1 = 0, n2 = 0;
        while (i < len1 && version1[i] != '.')
        {
            n1 = n1 * 10 + (version1[i] - '0');
            i++;
        }
        i++;
        while (j < len2 && version2[j] != '.')
        {
            n2 = n2 * 10 + (version2[j] - '0');
            j++;
        }
        j++;
        if (n1 > n2)
        {
            return 1;
        }
        else if (n1 < n2)
        {
            return -1;
        }
    }
    return 0;
}